package com.barbeque.mall.service.wx;

import com.barbeque.mall.bean.goods.MarketGoodsAttribute;
import com.barbeque.mall.bean.goods.MarketGoodsAttributeExample;
import com.barbeque.mall.mapper.MarketGoodsAttributeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 苏东宇
 * @since 2022/07/21 15:22
 */
@Service
public class WxAttributeServiceImpl implements WxAttributeService {

    @Autowired
    MarketGoodsAttributeMapper marketGoodsAttributeMapper;

    @Override
    public List<MarketGoodsAttribute> getAttributeByGoodsId(Integer goodsId) {
        MarketGoodsAttributeExample marketGoodsAttributeExample = new MarketGoodsAttributeExample();
        MarketGoodsAttributeExample.Criteria criteria = marketGoodsAttributeExample.createCriteria();
        criteria.andGoodsIdEqualTo(goodsId);
        criteria.andDeletedEqualTo(false);

        List<MarketGoodsAttribute> marketGoodsAttributes = marketGoodsAttributeMapper.selectByExample(marketGoodsAttributeExample);



        return marketGoodsAttributes;
    }
}
